<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateIncidenteTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_idIncidente}" for="idIncidente" />
                    <h:inputText id="idIncidente" value="#{incidenteController.selected.idIncidente}" title="#{bundle.CreateIncidenteTitle_idIncidente}" required="true" requiredMessage="#{bundle.CreateIncidenteRequiredMessage_idIncidente}"/>
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_nombreRegistrante}" for="nombreRegistrante" />
                    <h:inputText id="nombreRegistrante" value="#{incidenteController.selected.nombreRegistrante}" title="#{bundle.CreateIncidenteTitle_nombreRegistrante}" />
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_descripcion}" for="descripcion" />
                    <h:inputText id="descripcion" value="#{incidenteController.selected.descripcion}" title="#{bundle.CreateIncidenteTitle_descripcion}" />
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_hora}" for="hora" />
                    <h:inputText id="hora" value="#{incidenteController.selected.hora}" title="#{bundle.CreateIncidenteTitle_hora}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_fecha}" for="fecha" />
                    <h:inputText id="fecha" value="#{incidenteController.selected.fecha}" title="#{bundle.CreateIncidenteTitle_fecha}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_gravedad}" for="gravedad" />
                    <h:inputText id="gravedad" value="#{incidenteController.selected.gravedad}" title="#{bundle.CreateIncidenteTitle_gravedad}" />
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_numeroEstacionamiento}" for="numeroEstacionamiento" />
                    <h:inputText id="numeroEstacionamiento" value="#{incidenteController.selected.numeroEstacionamiento}" title="#{bundle.CreateIncidenteTitle_numeroEstacionamiento}" />
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_placa}" for="placa" />
                    <h:inputText id="placa" value="#{incidenteController.selected.placa}" title="#{bundle.CreateIncidenteTitle_placa}" />
                    <h:outputLabel value="#{bundle.CreateIncidenteLabel_vehiculo}" for="vehiculo" />
                    <h:selectOneMenu id="vehiculo" value="#{incidenteController.selected.vehiculo}" title="#{bundle.CreateIncidenteTitle_vehiculo}" >
                        <f:selectItems value="#{vehiculoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{incidenteController.create}" value="#{bundle.CreateIncidenteSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{incidenteController.prepareList}" value="#{bundle.CreateIncidenteShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateIncidenteIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
